---
title: Vercel AI SDK Provider
subtitle: Use Composio with Vercel AI SDK
slug: /providers/vercel
image: "https://og.composio.dev/api/og?title=Vercel%20AI%20SDK%20Provider"   # image for socials
keywords: ''
hide-nav-links: false
---

Vercel AI SDK allows you to configure an optional async `execute` function that the framework uses to execute the tool calls.

The Vercel provider for Composio formats the Composio tools and adds this `execute` function to the tool calls.

## Setup

Vercel AI SDK and the provider are only available for the TypeScript SDK.

```typescript TypeScript maxLines=60 wordWrap
npm install @composio/vercel
```

You can specify and import the provider in the constructor.

```typescript TypeScript maxLines=60 wordWrap
import { Composio } from '@composio/core';
import { VercelProvider } from '@composio/vercel';
import { generateText } from 'ai';
import { openai } from "@ai-sdk/openai";

const composio = new Composio({
  provider: new VercelProvider(),
});
```

## Usage

```typescript TypeScript maxLines=60 wordWrap
// create an auth config for gmail 
// then create a connected account with an external user id that identifies the user
const externalUserId = "your-external-user-id";
const tools = await composio.tools.get(externalUserId, "GMAIL_SEND_EMAIL");

// env: OPENAI_API_KEY
const { text } = await generateText({
  model: openai("gpt-5"),
  messages: [
    {
      role: "user",
      content: `Send an email to soham.g@composio.dev with the subject 'Hello from composio 👋🏻' and the body 'Congratulations on sending your first email using AI Agents and Composio!'`,
    },
  ],
  tools,
});

console.log("Email sent successfully!", { text });
```
